{if $session_is_teacher neq NULL}
<center>
	<h2>Feladatlapok listája</h2>
	{$date = date("Y-m-d")}
	<table id="mytable">
		<tr>
			<th id="myth">Név</th>
			<th id="myth">Létrehozás időpontja</th>
			<th id="myth">Lejárat időpontja</th>
			{if $session_is_teacher eq 1}<th id="myth">Módosítás</th>{/if}
			{if $session_is_teacher eq 1}<th id="myth">Törlés</th>{/if}
			{if $session_is_teacher eq 1}<th id="myth">Véglegesítés</th>{/if}
			{if $session_is_teacher eq 0}<th id="myth">Kitölthető</th>{/if}
		</tr>
		{for $counter=0 ; $counter < $tasksheetcount ; $counter++}
			{if $session_is_teacher eq 1 OR ($session_is_teacher eq 0 AND $tasksheets[$counter]['is_ready'] eq 1)}
			<tr>
				<td id="mytd"><center>{if ($alreadysubmited[$counter] eq 0 AND $date<=$tasksheets[$counter]['expire']) OR $session_is_teacher eq 1}<a href="?q=tasksheet/show/{$tasksheets[$counter]['id']}">{$tasksheets[$counter]['name']}</a>{else}{$tasksheets[$counter]['name']}{/if}</center></td>
				<td id="mytd"><center>{$tasksheets[$counter]['date']}</center></td>
				<td id="mytd"><center>{$tasksheets[$counter]['expire']}</center></td>
				{if $session_is_teacher eq 1}<td id="mytd"><center>{if $tasksheets[$counter]['is_ready'] eq 0}<a href="?q=tasksheet/edit/{$tasksheets[$counter]['id']}"><img src="view/images/button-edit.png" alt="Módosítás" /></a>{else}<img src="view/images/button-cross.png" alt="Nem módosítható" />{/if}</center></td>{/if}
				{if $session_is_teacher eq 1}<td id="mytd"><center>{if $tasksheets[$counter]['is_ready'] eq 0}<a href="?q=tasksheet/delete/{$tasksheets[$counter]['id']}"><img src="view/images/button-bin.png" alt="Törlés" /></a>{else}<img src="view/images/button-cross.png" alt="Nem törölhető" />{/if}</center></td>{/if}
				{if $session_is_teacher eq 1}<td id="mytd"><center>{if $tasksheets[$counter]['is_ready'] eq 0}<a href="?q=tasksheet/finalize/{$tasksheets[$counter]['id']}">Véglegesítés</a>{else}Végleges{/if}</center></td>{/if}
				{if $session_is_teacher eq 0}<td id="mytd"><center>{if $alreadysubmited[$counter] eq 0 AND $date<=$tasksheets[$counter]['expire']}<img src="view/images/button-check.png" alt="Kitöltés" />{else}<img src="view/images/button-cross.png" alt="Már kitöltötted" /></center>{/if}</td>{/if}
			</tr>	
			{/if}
		{/for}
	</table>
</center>
</form>
{else}
<center>
<h1>Ehhez nincs jogosultságod!</h1><br />
</center>
{/if}